<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="Commande">

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" >
    <fo:layout-master-set>
        <fo:simple-page-master master-name="LetterPage" page-width="8.5in"  
                               page-height="11in" >
            <fo:region-body region-name="PageBody" margin="0.7in"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="LetterPage">
        <fo:flow flow-name="PageBody">
           <xsl:apply-templates match="." />
        </fo:flow>
    </fo:page-sequence>
</fo:root>


</xsl:template>

<xsl:template match="Commande">
<fo:table  border-collapse="collapse"  font-size="12pt" font-family="Arial" >
    <fo:table-column column-width="3in" background-color="rgb(255,246,206)" />
    <fo:table-column column-width="50%" />
    <fo:table-column column-width="50%" />
    <fo:table-header  color="rgb(255,255,255)" background-color="rgb(125,73,2)" 
                        font-weight="bold">
                        
        <fo:table-row>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block>Nom</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block>Prix</fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block>Personnalisé (Ingrédients pizza perso)</fo:block>
            </fo:table-cell>
        </fo:table-row>
    </fo:table-header>
    
    <fo:table-body >
    <xsl:for-each select="Items/Item" >
        <fo:table-row>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block><xsl:value-of select="nom" /></fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block><xsl:value-of select="prix" /></fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block><xsl:for-each select="Ingredient" ><xsl:value-of select="." /></xsl:for-each></fo:block>
            </fo:table-cell>
        </fo:table-row>
     </xsl:for-each>
     <fo:table-row>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block font-weight="bold">Total<xsl:value-of select="prix" /></fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block font-weight="bold">ID<xsl:value-of select="prix" /></fo:block>
            </fo:table-cell>
            <fo:table-cell padding="2pt" border="1pt solid black">
                <fo:block font-weight="bold"><xsl:for-each select="Ingredient" ><xsl:value-of select="." /></xsl:for-each></fo:block>
            </fo:table-cell>
        </fo:table-row>
       
    </fo:table-body>
   
</fo:table>

</xsl:template>
</xsl:stylesheet>